<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="module-locale.html" />
<link rel="prev" href="i18n.html" />
<link rel="parent" href="i18n.html" />
<link rel="next" href="node731.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>21.1 gettext -- Multilingual internationalization services</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="21. Internationalization"
  href="i18n.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="21. Internationalization"
  href="i18n.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="21.1.1 gnu gettext API"
  href="node731.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="i18n.html">21. Internationalization</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="i18n.html">21. Internationalization</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node731.html">21.1.1 GNU gettext API</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h1><a name="SECTION0023100000000000000000">
21.1 <tt class="module">gettext</tt> --
         Multilingual internationalization services</a>
</h1>

<p>
<a name="module-gettext"></a>

<p>
The <tt class="module">gettext</tt> module provides internationalization (I18N) and
localization (L10N) services for your Python modules and applications.
It supports both the GNU <code>gettext</code> message catalog API and a
higher level, class-based API that may be more appropriate for Python
files.  The interface described below allows you to write your
module and application messages in one natural language, and provide a
catalog of translated messages for running under different natural
languages.

<p>
Some hints on localizing your Python modules and applications are also
given.

<p>

<p><br /></p><hr class='online-navigation' />
<div class='online-navigation'>
<!--Table of Child-Links-->
<a name="CHILD_LINKS"><strong>Subsections</strong></a>

<ul class="ChildLinks">
<li><a href="node731.html">21.1.1 GNU <b class="program">gettext</b> API</a>
<li><a href="node732.html">21.1.2 Class-based API</a>
<ul>
<li><a href="node733.html">21.1.2.1 The <tt class="class">NullTranslations</tt> class</a>
<li><a href="node734.html">21.1.2.2 The <tt class="class">GNUTranslations</tt> class</a>
<li><a href="node735.html">21.1.2.3 Solaris message catalog support</a>
<li><a href="node736.html">21.1.2.4 The Catalog constructor</a>
</ul>
<li><a href="node737.html">21.1.3 Internationalizing your programs and modules</a>
<ul>
<li><a href="node738.html">21.1.3.1 Localizing your module</a>
<li><a href="node739.html">21.1.3.2 Localizing your application</a>
<li><a href="node740.html">21.1.3.3 Changing languages on the fly</a>
<li><a href="node741.html">21.1.3.4 Deferred translations</a>
<li><a href="node742.html">21.1.3.5 <tt class="function">gettext()</tt> vs. <tt class="function">lgettext()</tt></a>
</ul>
<li><a href="node743.html">21.1.4 Acknowledgements</a>
</ul>
<!--End of Table of Child-Links-->
</div>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="21. Internationalization"
  href="i18n.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="21. Internationalization"
  href="i18n.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="21.1.1 gnu gettext API"
  href="node731.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="i18n.html">21. Internationalization</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="i18n.html">21. Internationalization</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node731.html">21.1.1 GNU gettext API</a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
